home *** CD-ROM | disk | FTP | other *** search
/ Collection of Tools & Utilities / Collection of Tools and Utilities.iso / ada / adatu200.zip / ADA_TUTR.ADA < prev    next >
Text File  |  1991-03-25  |  26KB  |  518 lines

  1. -- ADA_TUTR.ADA   Ver. 2.00   25-MAR-1991   Copyright 1988-1991 John J. Herro
  2. -- Software Innovations Technology
  3. -- 1083 Mandarin Drive NE, Palm Bay, FL  32905-4706   (407)951-0233
  4. --
  5. -- Before compiling this file, you must compile ONE of the following:
  6. --
  7. --    MERIDIAN.ADA  Recommended when using a PC with a Meridian Ada compiler
  8. --                     and the Meridian DOS Environment Library.
  9. --    UNIX.ADA      Recommended for UNIX based systems, if you can also
  10. --                     compile ONECHAR.C or ALTCHAR.C with a C compiler and
  11. --                     link with Ada.
  12. --    VAX.ADA       Recommended when using VAX Ada.
  13. --    VANILLA.ADA   "Plain vanilla" version for all other systems.  Should work
  14. --                     with ANY standard Ada compiler.  On some systems,
  15. --                     VANILLA.ADA may require you to strike ENTER after each
  16. --                     response.  However, you don't have to strike ENTER with
  17. --                     recent versions of TeleGen Ada by Telesoft.
  18. --
  19. -- See the PRINT.ME file for more information on installing ADA-TUTR on other
  20. -- computers.
  21. --
  22. --
  23. -- Before Running ADA-TUTR on a PC:
  24. --
  25. -- ADA-TUTR uses ANSI escape sequences for highlighting, cursor positioning,
  26. -- reverse video, etc.  Before ADA-TUTR will work correctly on a PC, you must
  27. -- install the device driver ANSI.SYS, which came with your copu of DOS.  To
  28. -- install ANSI.SYS, do the following:
  29. --
  30. -- 1.  If there's a file CONFIG.SYS in the root directory of the disk from
  31. --     which you boot, type it and look for a line saying "DEVICE=ANSI.SYS"
  32. --     (without the quotes), in either upper or lower case.  If that line isn't
  33. --     present, add it to CONFIG.SYS anywhere in the file, using an ordinary
  34. --     text editor or word processor in the non-document mode.  If there's no
  35. --     CONFIG.SYS file, create one containing the single line "DEVICE=ANSI.SYS"
  36. --     (without the quotes).
  37. --
  38. -- 2.  If there's no file ANSI.SYS in your root directory, copy ANSI.SYS from
  39. --     your DOS distribution diskette to the root directory of the disk from
  40. --     which you boot.
  41. --
  42. -- 3.  Reboot the computer.  ADA-TUTR should then work correctly.
  43. --
  44.  
  45. -- Introduction:
  46. --
  47. -- ADA-TUTR provides interactive instruction in the Ada programming language,
  48. -- allowing you to learn at your own pace.  On a PC, access to an Ada compiler
  49. -- is helpful, but not required.  You can exit this program at any time by
  50. -- striking X, and later resume the session exactly where you left off.  If you
  51. -- have a color monitor, you can set the foreground, background, and border
  52. -- colors at any time by typing S.
  53. --
  54. -- ADA-TUTR presents a screenful of information at a time.  Screens are read
  55. -- in 64-byte blocks from the random access file ADA_TUTR.DAT, using DIRECT_IO.
  56. -- For most screens, ADA-TUTR waits for you to strike one character to
  57. -- determine which screen to show next.  Screens are numbered starting with
  58. -- 101; each screen has a three-digit number.  Screens 101 through 108 have
  59. -- special uses, as follows:
  60. --
  61. -- 101 - This screen is presented when you complete the Ada course.  It
  62. --       contains a congratulatory message.  After this screen is shown,
  63. --       control returns directly to the operating system; the program doesn't
  64. --       wait for you to strike a character.
  65. -- 102 - This screen is presented when you exit ADA-TUTR before completing the
  66. --       course.  After this screen is shown, control returns directly to the
  67. --       operating system; the program doesn't wait for you to strike a
  68. --       character.
  69. -- 103 - This screen is shown whenever you strike X.  It displays the number of
  70. --       the last screen shown and the approximate percentage through the
  71. --       course.  It then asks if you want to exit the program.  If you strike
  72. --       Y, screen 102 is shown and control returns to the operating system.
  73. --       If you type N, screen 108 is shown to provide a menu of further
  74. --       choices.  From screen 103, you can also strike M to see the main menu
  75. --       (screen 106).
  76. -- 104 - This is the opening screen.  It asks if you've used ADA-TUTR before.
  77. --       If you strike N, a welcome screen is presented and the course begins.
  78. --       If you strike Y, screen 107 is shown.
  79. -- 105 - This screen allows you to type the number of the next screen you want
  80. --       to see.  For this screen, instead of striking one character, you type
  81. --       a three-digit number and presses ENTER.  Any number from 104 through
  82. --       the largest screen number is accepted.
  83. -- 106 - This screen contains the main menu of topics covered in ADA-TUTR.
  84. --       When you select a main topic, an appropriate sub-menu is shown.
  85. -- 107 - This screen is shown when you say that you've used ADA-TUTR before.
  86. --       It says "Welcome back!" and provides a menu that lets you resume where
  87. --       you left off, go back to the last question or Outside Assignment, go
  88. --       to the main menu (screen 106), or go to any specified screen number
  89. --       (via screen 105).
  90. -- 108 - This screen is shown when you answer N to screen 103.  It provides a
  91. --       menu similar to screen 107, except that the first choice takes you
  92. --       back to the screen shown before you saw 103.  For example, if you
  93. --       strike X while viewing screen 300, you'll see screen 103.  If you then
  94. --       answer N, you'll see screen 108.  From 108 the first menu selection
  95. --       takes you back to 300.
  96. --
  97.  
  98. -- Format of the Data File:
  99. --
  100. -- ADA-TUTR.DAT is a random access file of 64-byte blocks.  The format of this
  101. -- file changed considerably with version 2.00 of ADA-TUTR.  It's now much more
  102. -- compact, and, although it's still a data file, it now contains only the 95
  103. -- printable ASCII characters.
  104. --
  105. -- The first block of ADA_TUTR.DAT is referred to as block 1, and the first 31
  106. -- blocks together are called the index.  Bytes 2 through 4 of block 1 contain,
  107. -- in ASCII, the number of the welcome screen that's shown when you say that
  108. -- you haven't used ADA-TUTR before.  Bytes 6 through 8 of block 1 contain the
  109. -- number of the highest screen in the course.  (Bytes 1 and 5 of block 1
  110. -- contain spaces.)
  111. --
  112. -- Bytes 9 of block 1 through the end of block 31 contain four bytes of
  113. -- information for each of the possible screens 101 through 594.  For example,
  114. -- information for screen 101 is stored in bytes 9 through 12 of block 1, the
  115. -- next four bytes are for screen 102, etc.  For screens that don't exist, all
  116. -- four bytes contain spaces.
  117. --
  118. -- The first of the four bytes is A if the corresponding screen introduces an
  119. -- Outside Assignment, Q if the screen asks a question, or a space otherwise.
  120. -- The next two bytes give the number of the block where data for the screen
  121. -- begins, in base 95!  A space represents 0, ! represents 1, " represents 2,
  122. -- # represents 3, $ represents 4, etc., through all the printable characters
  123. -- of the ASCII set.  A tilde (~) represents 94.
  124. --
  125. -- The last of the four bytes gives the position, 1 through 64, within the
  126. -- block where the data for this screen starts.  Again, ! represents 1,
  127. -- " represents 2, # represents 3, etc.
  128. --
  129. -- Data for the screens are stored starting in position 1 of block 32.  In the
  130. -- screen data, the following characters have special meaning:
  131. --
  132. --           %  turns on high intensity.
  133. --           @  displays the number of spaces indicated by the next
  134. --                 character (# represents 3, $ represents 4, etc.)
  135. --           \  turns on reverse video and leaves one space.
  136. --           ^  turns on high intensity and leaves one space.
  137. --           `  restores normal video.
  138. --           {  causes CR-LF.
  139. --           }  moves cursor to row 24, column 1, for a prompt.
  140. --           ~  restores normal video and leaves one space.
  141. --
  142. -- These characters have special meaning in screen 103 only:
  143. --
  144. --           #  shows approximate percentage through the course.
  145. --           $  shows the number of the screen seen before 103.
  146. --
  147. -- Immediately after }, b represents "Please type a space to go on, or B to go
  148. -- bac